# 保存淘宝的登录信息，以便于selenium淘宝搜索内容的直接模拟登录，不弹出登录界面
import json
from selenium import webdriver
import time

driver = webdriver.Chrome()
driver.get('https://login.taobao.com/')
time.sleep(10)
dictCookies = driver.get_cookies()
jsonCookies = json.dumps(dictCookies)

with open('cookie_tao.json', 'w') as fp:
    fp.write(jsonCookies)